/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * DetalhesDoClientePanel.java
 *
 * Created on Nov 9, 2010, 11:15:49 PM
 */

package br.com.tbp.gui;

import br.com.tbp.model.domain.Empresa;

/**
 *
 * @author Diego Freire
 */
public class DetalhesDaEmpresaPanel extends javax.swing.JPanel {

    public DetalhesDaEmpresaPanel(Empresa e) {
        initComponents();
        mostraDados(e);
    }
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        detalhePanel = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        cnpjLabel = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        inscricaoLabel = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        foneLabel = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        enderecoLabel = new javax.swing.JLabel();

        setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 13, 4, 13));
        setLayout(new java.awt.BorderLayout());

        detalhePanel.setBackground(new java.awt.Color(235, 179, 123));

        jLabel4.setText("CNPJ:");

        cnpjLabel.setText("000.000.000-00");

        jLabel6.setText("Insc. Estad.:");

        inscricaoLabel.setText("4899843943/0001-439");

        jLabel8.setText("Fone:");

        foneLabel.setText("81 9988.1328");

        jLabel10.setText("Endereço:");

        enderecoLabel.setText("Rua Gouveia de Barros, Maurício de Nassau, Nº 533, Caruaru - PE");

        javax.swing.GroupLayout detalhePanelLayout = new javax.swing.GroupLayout(detalhePanel);
        detalhePanel.setLayout(detalhePanelLayout);
        detalhePanelLayout.setHorizontalGroup(
            detalhePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(detalhePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(detalhePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(detalhePanelLayout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cnpjLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel6)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(inscricaoLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE)
                        .addGap(17, 17, 17)
                        .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(foneLabel))
                    .addGroup(detalhePanelLayout.createSequentialGroup()
                        .addComponent(jLabel10)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(enderecoLabel)))
                .addContainerGap())
        );
        detalhePanelLayout.setVerticalGroup(
            detalhePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(detalhePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(detalhePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(cnpjLabel)
                    .addComponent(jLabel8)
                    .addComponent(foneLabel)
                    .addComponent(jLabel6)
                    .addComponent(inscricaoLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(detalhePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(enderecoLabel))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        add(detalhePanel, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel cnpjLabel;
    private javax.swing.JPanel detalhePanel;
    private javax.swing.JLabel enderecoLabel;
    private javax.swing.JLabel foneLabel;
    private javax.swing.JLabel inscricaoLabel;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel8;
    // End of variables declaration//GEN-END:variables

    private void mostraDados(Empresa e) {
        cnpjLabel.setText(e.getCnpj());
        inscricaoLabel.setText(e.getInscricao());
        foneLabel.setText(e.getTelefone());
        enderecoLabel.setText(e.getEndereco() != null ? e.getEndereco().toString() : null);
    }

}
